<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>
      <?php echo ($system['name']); if((CONTROLLER_NAME == 'Funding') AND (ACTION_NAME == 'detail')): ?>-<?php echo ($model['name']); endif; ?>
    </title>

    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="/travel_prod/Public/sui/sm.min.css">
    <link rel="stylesheet" href="/travel_prod/Public/sui/sm-extend.min.css">
    <link rel="stylesheet" href="/travel_prod/Public/sui/main.css">
    <script type='text/javascript' src='/travel_prod/Public/sui/zepto.min.js' charset='utf-8'></script>
    <script type="text/javascript">
      $.config={
        route:false
      }
    </script>
    <script type='text/javascript' src='/travel_prod/Public/sui/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/travel_prod/Public/sui/sm-extend.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/travel_prod/Public/sui/jquery-3.1.1.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/travel_prod/Public/sui/main.js' charset='utf-8'></script>
    <!-- frozen定制表格 -->
    <!--<link rel="stylesheet" href="/travel_prod/Public/frozen/css/frozen.css">
    <script type='text/javascript' src='/travel_prod/Public/frozen/js/frozen.js' charset='utf-8'></script>-->
    <link href="/travel_prod/Public/jquery.dial-master/css/jquery.dial.css" rel="stylesheet" >
     <link href="/Public/hadmin/css/travelgame.css" rel="stylesheet">
    <script  src="/travel_prod/Public/jquery.dial-master/js/jquery.dial.js"></script>
    <link rel="stylesheet" href="/travel_prod/Public/font-awesome-4.7.0/css/font-awesome.min.css">
  </head>
  <body>
    <div class="page-group">
        <input type="hidden" id="post" value="<?php echo count($_POST);?>">
        <div class="page page-current">
          <header class="bar bar-nav header">
            <?php if($sui['return']): ?><a class="button button-link button-nav pull-left return">
                <span class="icon icon-left"></span>
              </a><?php endif; ?>
            <h1 class="title"><?php echo ($title); ?></h1>
            <a class="button button-link button-nav pull-right" href="<?php echo U('Home/User/index');?>">
              <span class="icon icon-me" style="margin-right:0.5em;"></span>
            </a>
          </header>
          <div class="header-replace"></div>
          <nav class="bar bar-tab">
            <a class="tab-item <?php echo ($sui['index']); ?>" href="<?php echo U('Home/Index/index');?>">
              <span class="icon icon-home"></span>
              <span class="tab-label">首页</span>
            </a>
            <a class="tab-item <?php echo ($sui['customized']); ?>" href="<?php echo U('Home/Index/customized');?>">
              <span class="icon icon-edit"></span>
              <span class="tab-label">定制</span>
            </a>
            <a class="tab-item <?php echo ($sui['funding']); ?>" href="<?php echo U('Home/Funding/list');?>">
              <span class="icon icon-friends"></span>
              <span class="tab-label">众筹</span>
            </a>
            <a class="tab-item <?php echo ($sui['game']); ?>" href="<?php echo U('Home/Travelgame/list');?>">
              <span class="icon icon-gift"></span>
              <span class="tab-label">大赛</span>
            </a>
          <?php $noticeCount = D('Notice')->where(['receive_user_id'=>session('用户')['id'], 'state'=>'未读'])->count(); if ($noticeCount != 0) { $new = true; } else { $new = false; } ?>
          <style type="text/css">
            .red-dot {
                  display:block;
                  background:#f00;
                  border-radius:50%;
                  width:5px;
                  height:5px;
                  top:-1.3rem;
                  right:1.5rem;
                  position:absolute;
            }
          </style>

            <a class="tab-item <?php echo ($sui['information']); ?>" href="<?php echo U('Home/Index/information');?>" >
              <span class="icon icon-me"></span>
              <span class="tab-label">信息<?php if($new): ?><i class="red-dot"></i><?php endif; ?></span>
            </a>
          </nav>
          <div class="content">

<div class="bar bar-header-secondary" style="top:0;">
  <div class="searchbar">
    <a class="searchbar-cancel">取消</a>
    <div class="search-input">
      <label class="icon icon-search" for="search"></label>
      <form action="/travel_prod/index.php/Home/funding/list" method="get">
        <input type="search" id='searchMap[name]' name='searchMap[name]' placeholder='输入关键字...' style="padding-left: 1.5rem;" />
      </form>
    </div>
  </div>
</div>
<link rel="stylesheet" type="text/css" href="/travel_prod/Public/swipe/css/swipe.css">
<div class="addWrap" style="margin-top: 2.2rem;">
    <div class="swipe" id="mySwipe">
        <div class="swipe-wrap">
            <?php if(is_array($ad)): $i = 0; $__LIST__ = $ad;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div>
                    <a href="<?php echo ($vo['href']); ?>"><img class="img-responsive" src="/travel_prod/Public/file/<?php echo ($vo['picture']); ?>" /></a>
                </div><?php endforeach; endif; else: echo "" ;endif; ?>
        </div>
    </div>
    <ul id="position">
        <?php if(is_array($ad)): $i = 0; $__LIST__ = $ad;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li <?php if($i == 1): ?>class="cur"<?php endif; ?> ></li><?php endforeach; endif; else: echo "" ;endif; ?>
    </ul>
</div>
<script src="/travel_prod/Public/swipe/js/swipe.js"></script>
<script type="text/javascript">
var bullets = document.getElementById('position').getElementsByTagName('li');
var banner = Swipe(document.getElementById('mySwipe'), {
    auto: 2000,
    continuous: true,
    disableScroll: false,
    callback: function(pos) {
        var i = bullets.length;
        while (i--) {
            bullets[i].className = ' ';
        }
        bullets[pos].className = 'cur';
    }
});
</script>
<div style="font-size:1.2em;margin-top:0.5rem;">
    <span class="color-block">&nbsp;</span>&nbsp;当前位置：<span id="address">获取中...</span>
</div>
<script type="text/javascript">
    function Location(){};
Location.prototype.getLocation = function(callback){
  var options = {
    enableHighAccuracy: true,
    maximumAge: 1000
  };
  this.callback = Object.prototype.toString.call(callback) =="[object Function]" ?
    callback : 
    function(address){
      // alert(address.province + address.city);
      console.log("getocation(callbackFunction) 可获得定位信息对象");
    };
  var self = this;
  if (navigator.geolocation) {
    //浏览器支持geolocation
    navigator.geolocation.getCurrentPosition(function(position){
      //经度
      var longitude = position.coords.longitude;
      //纬度
      var latitude = position.coords.latitude;
      self.loadMapApi(longitude,latitude);
    }, self.onError, options);
  } else {
    //浏览器不支持geolocation
  }
};
Location.prototype.loadMapApi = function(longitude, latitude){
  var self = this;
  var oHead = document.getElementsByTagName('HEAD').item(0);
  var oScript= document.createElement("script");
  oScript.type = "text/javascript";
  oScript.src="http://api.map.baidu.com/getscript?v=2.0&ak=A396783ee700cfdb9ba1df281ce36862&services=&t=20140930184510";
  oHead.appendChild(oScript);
  oScript.onload = function(date){
    var point = new BMap.Point(longitude, latitude);
    var gc = new BMap.Geocoder();
    gc.getLocation(point, function(rs) {
      var addComp = rs.addressComponents;
      self.callback(addComp);
    });
  }
};
Location.prototype.onError = function(error) {
  switch (error.code) {
    case 1:
      // alert("位置服务被拒绝");
      break;
    case 2:
      // alert("暂时获取不到位置信息");
      break;
    case 3:
      // alert("获取信息超时");
      break;
    case 4:
      // alert("未知错误");
      break;
  }
};
//调用
var local = new Location();
local.getLocation(function(res){
    $('#address').html(res.city);
})
</script>
<div style="font-size:1.2em;margin-top:0.5rem;">
    <span class="color-block">&nbsp;</span>&nbsp;热门目的地
</div>
<?php if(is_array($destinationFunding)): $i = 0; $__LIST__ = $destinationFunding;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="card">
        <div class="card-header">
            <span class="icon icon-friends"></span> <?php echo D('FundingType')->where(['id'=>$vo['funding_type']])->find()['long_name'];?>
        </div>
        <div class="card-content">
            <div class="card-content-inner">
                <a href="<?php echo U('Funding/detail', ['id'=>$vo['id']]);?>">
                    <img class="list-img" src="/travel_prod/Public/file/<?php echo ($vo['img']); ?>" />
                    <div class="list-name-div">
                        <span class="list-name"><?php echo ($vo['name']); ?></span>
                    </div>
                    <div class="list-info">
                        <span class="list-info-item"><span class="icon icon-app"></span> <?php echo ($vo['funding_price']); ?> 元</span>
                        <br/>
                        <span class="list-info-item"><span class="icon icon-friends"></span> <?php echo ($vo['already_num']); ?>/<?php echo ($vo['total_num']); ?>人参与</span>
                    </div>
                </a>
                <!--
                <div class="list-desc">
                    <?php echo (html_entity_decode($vo['detail_wap'])); ?>
                </div>
                -->
            </div>
        </div>
        <div class="card-footer">
            <a href="<?php echo U('Funding/buy', ['id'=>$vo['id']]);?>" class="button"><span class="icon icon-star"></span> 立即参加</a>
            <a href="<?php echo U('Funding/detail', ['id'=>$vo['id']]);?>" class="button"><span class="icon icon-search"></span> 查看详情</a>
        </div>
    </div><?php endforeach; endif; else: echo "" ;endif; ?>
<div style="font-size:1.2em;margin-top:0.5rem;">
    <span class="color-block">&nbsp;</span>&nbsp;热门筹单
</div>
<?php if(is_array($hotFunding)): $i = 0; $__LIST__ = $hotFunding;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="card">
        <div class="card-header">
            <span class="icon icon-friends"></span> <?php echo D('FundingType')->where(['id'=>$vo['funding_type']])->find()['long_name'];?>
        </div>
        <div class="card-content">
            <div class="card-content-inner">
                <a href="<?php echo U('Funding/detail', ['id'=>$vo['id']]);?>">
                    <img class="list-img" src="/travel_prod/Public/file/<?php echo ($vo['img']); ?>" />
                    <div class="list-name-div">
                        <span class="list-name"><?php echo ($vo['name']); ?></span>
                    </div>
                    <div class="list-info">
                        <span class="list-info-item"><span class="icon icon-app"></span> <?php echo ($vo['funding_price']); ?> 元</span>
                        <br/>
                        <span class="list-info-item"><span class="icon icon-friends"></span> <?php echo ($vo['already_num']); ?>/<?php echo ($vo['total_num']); ?>人参与</span>
                    </div>
                </a>
                <!--
                <div class="list-desc">
                    <?php echo (html_entity_decode($vo['detail_wap'])); ?>
                </div>
                -->
            </div>
        </div>
        <div class="card-footer">
            <a href="<?php echo U('Funding/buy', ['id'=>$vo['id']]);?>" class="button"><span class="icon icon-star"></span> 立即参加</a>
            <a href="<?php echo U('Funding/detail', ['id'=>$vo['id']]);?>" class="button"><span class="icon icon-search"></span> 查看详情</a>
        </div>
    </div><?php endforeach; endif; else: echo "" ;endif; ?>
<div style="font-size:1.2em;margin-top:0.5rem;">
    <span class="color-block">&nbsp;</span>&nbsp;天天优惠
</div>
<?php if(is_array($discountFunding)): $i = 0; $__LIST__ = $discountFunding;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="card">
        <div class="card-header">
            <span class="icon icon-friends"></span> <?php echo D('FundingType')->where(['id'=>$vo['funding_type']])->find()['long_name'];?>
        </div>
        <div class="card-content">
            <div class="card-content-inner">
                <a href="<?php echo U('Funding/detail', ['id'=>$vo['id']]);?>">
                    <img class="list-img" src="/travel_prod/Public/file/<?php echo ($vo['img']); ?>" />
                    <div class="list-name-div">
                        <span class="list-name"><?php echo ($vo['name']); ?></span>
                    </div>
                    <div class="list-info">
                        <span class="list-info-item"><span class="icon icon-app"></span> <?php echo ($vo['funding_price']); ?> 元</span>
                        <br/>
                        <span class="list-info-item"><span class="icon icon-friends"></span> <?php echo ($vo['already_num']); ?>/<?php echo ($vo['total_num']); ?>人参与</span>
                    </div>
                </a>
                <!--
                <div class="list-desc">
                    <?php echo (html_entity_decode($vo['detail_wap'])); ?>
                </div>
                -->
            </div>
        </div>
        <div class="card-footer">
            <a href="<?php echo U('Funding/buy', ['id'=>$vo['id']]);?>" class="button"><span class="icon icon-star"></span> 立即参加</a>
            <a href="<?php echo U('Funding/detail', ['id'=>$vo['id']]);?>" class="button"><span class="icon icon-search"></span> 查看详情</a>
        </div>
    </div><?php endforeach; endif; else: echo "" ;endif; ?>
</div>
</div>
</div>
<div class="panel-overlay"></div>
<div class="panel panel-left panel-reveal theme-dark" id='select-panel-guider'>
    <div class="content-block">
        <p>根据条件筛选</p>
    </div>
    <form>
        <div class="list-block">
            <ul>
                <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" name="searchMap[location]" placeholder="服务地区" value="<?php echo ($_GET['searchMap']['location']); ?>">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <select name="searchMap[age]">
                                    <option value="">年龄不限</option>
                                    <option value="0,20" <?php if($_GET['searchMap']['age'] == '0,20'): ?>selected<?php endif; ?>>20岁以下</option>
                                    <option value="21,30" <?php if($_GET['searchMap']['age'] == '21,30'): ?>selected<?php endif; ?>>21~30岁</option>
                                    <option value="31,40" <?php if($_GET['searchMap']['age'] == '31,40'): ?>selected<?php endif; ?>>31~40岁</option>
                                    <option value="41,50" <?php if($_GET['searchMap']['age'] == '41,50'): ?>selected<?php endif; ?>>41~50岁</option>
                                    <option value="51,100" <?php if($_GET['searchMap']['age'] == '51,100'): ?>selected<?php endif; ?>>51岁以上</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <select name="searchMap[gender]">
                                    <option value="">性别不限</option>
                                    <option value="男" <?php if($_GET['searchMap']['gender'] == '男'): ?>selected<?php endif; ?>>男</option>
                                    <option value="女" <?php if($_GET['searchMap']['gender'] == '女'): ?>selected<?php endif; ?>>女</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <select name="searchMap[degree]">
                                    <option value="">导游学历</option>
                                    <option value="专科" <?php if($_GET['searchMap']['degree'] == '专科'): ?>selected<?php endif; ?>>专科</option>
                                    <option value="本科" <?php if($_GET['searchMap']['degree'] == '本科'): ?>selected<?php endif; ?>>本科</option>
                                    <option value="硕士" <?php if($_GET['searchMap']['degree'] == '硕士'): ?>selected<?php endif; ?>>硕士</option>
                                    <option value="博士" <?php if($_GET['searchMap']['degree'] == '博士'): ?>selected<?php endif; ?>>博士</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" name="searchMap[special]" placeholder="导游专长" value="<?php echo ($_GET['searchMap']['special']); ?>">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" name="searchMap[nationality]" placeholder="导游国籍" value="<?php echo ($_GET['searchMap']['nationality']); ?>">
                            </div>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <div class="content-block">
            <div class="row">
                <div class="col-50"><a href="#" class="button button-big button-fill button-danger close-panel">取消</a></div>
                <div class="col-50">
                    <input type="submit" class="button button-big button-fill button-success" />
                </div>
            </div>
        </div>
    </form>
</div>
<div class="panel panel-left panel-reveal theme-dark" id='select-panel-funding'>
    <div class="content-block">
        <p>根据条件筛选</p>
    </div>
    <form>
        <div class="list-block">
            <ul>
                <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" name="searchMap[name]" placeholder="关键字" value="<?php echo ($_GET['searchMap']['name']); ?>">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <select name="searchMap[funding_type]">
                                    <option value="">众筹类型</option>
                                    <?php $fundingTypeList = D('FundingType')->select(); ?>
                                    <?php if(is_array($fundingTypeList)): $i = 0; $__LIST__ = $fundingTypeList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo['id']); ?>" <?php if($_GET['searchMap']['funding_type'] == $vo['id']): ?>selected<?php endif; ?>><?php echo ($vo['long_name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                            </div>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <div class="content-block">
            <div class="row">
                <div class="col-50"><a href="#" class="button button-big button-fill button-danger close-panel">取消</a></div>
                <div class="col-50">
                    <input type="submit" class="button button-big button-fill button-success" />
                </div>
            </div>
        </div>
    </form>
</div>

<div class="panel panel-left panel-reveal theme-dark" id='select-panel-travelgame'>
    <div class="content-block">
        <p>根据条件筛选</p>
    </div>
    <form>
        <div class="list-block">
            <ul>
                <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" name="keyword" placeholder="关键字" value="<?php echo ($_GET['keyword']); ?>">
                            </div>
                        </div>
                    </div>
                    </li>
                    <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" name="departure" placeholder="始发地" value="<?php echo ($_GET['departure']); ?>">
                            </div>
                        </div>
                    </div>
                    </li>
                    <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" name="destination" placeholder="目的地" value="<?php echo ($_GET['destination']); ?>">
                            </div>
                        </div>
                    </div>
                    </li>
                    <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" name="days" placeholder="天数" value="<?php echo ($_GET['days']); ?>">
                            </div>
                        </div>
                    </div>
                    </li>
                    <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" name="startprice" placeholder="价格范围(起始)" value="<?php echo ($_GET['startprice']); ?>">
                            </div>
                        </div>
                    </div>
                </li> <li>
                    <div class="item-content">
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" name="endprice" placeholder="价格范围(结束)" value="<?php echo ($_GET['endprice']); ?>">
                            </div>
                        </div>
                    </div>
                </li>
              </ul>
        </div>
        <div class="content-block">
            <div class="row">
                <div class="col-50"><a href="#" class="button button-big button-fill button-danger close-panel">取消</a></div>
                <div class="col-50">
                    <input type="submit" class="button button-big button-fill button-success" />
                </div>
            </div>
        </div>
    </form>
</div>
</body>

</html>